<template>
    <div>
        <form-module-use-form
            :form-data="formData"
            :form-model="formModel"
            :rules="rules"
            @event="changeItem"
            @submit="submitForm"
        />
    </div>
</template>

<script setup>
import { ref } from 'vue'
const formModel = ref({})
const formData = [
    {
        eType: 'Input',
        prop: 'supplement_img',
        placeholder: '支持上传文件，支持格式：PDF、JPG、PNG大小不超过20M文件',
        label: 'input'
    },
    {
        eType: 'Radio',
        prop: 'supplement_imgs',
        label: 'imgs---',
        options: [
            {
                text: 'w',
                value: 1
            },
            {
                text: 'p',
                value: 2
            }
        ],
        hiddenItem: {
            check: [ 2, 1, undefined ],
            selectVal: [ 1, undefined ]
        }
    },
    {
        eType: 'Check',
        prop: 'check',
        options: [
            {
                text: 'w',
                value: 1
            },
            {
                text: 'p',
                value: 2
            },
            {
                text: 'w5',
                value: 5
            }
        ]
    },
    {
        eType: 'Switch',
        prop: 'switch',
        hiddenItem: {
            check: [ 5, undefined ]
        }
    },
    {
        eType: 'InputNumber',
        prop: 'inpuV',
        isClass: true,
        hiddenItem: {
            supplement_imgs: [ 1, undefined ]
        }
    },
    {
        eType: 'InputNumber',
        prop: 'inpuVs'
    },
    {
        eType: 'Select',
        prop: 'selectVal',
        clearable: true,
        multiple: true,
        collapseTages: true,
        options: [
            {
                text: 'w搁浅刚',
                value: 1
            },
            {
                text: 'p',
                value: 2
            }
        ]
    },
    {
        eType: 'DatePicker',
        prop: 'datesV',
        placeholder: '请选择日期'
    },
    {
        eType: 'DatePicker',
        prop: 'datesms',
        type: 'daterange',
        valueFormat: 'YYYY-MM-DD'
    },
    {
        eType: 'UploadImage',
        prop: 'imgList',
        limit: 1,
        fileMaxSize: 10
    },
    {
        eType: 'UploadImage',
        prop: 'imgLists',
        limit: 2
    },
    {
        eType: 'DatePicker',
        prop: 'datesT',
        type: 'datetime'
    },
    {
        eType: 'TimePicker',
        prop: 'times'
    }
]
const changeItem = () => {
}
const rules = {
    supplement_img: {
        required: true,
        message: 'Please input email address',
        trigger: 'blur'
    },
    supplement_imgs: {
        required: true,
        message: 'supplement_imgs',
        trigger: 'change'
    }
}
const submitForm = () => {
    console.log(formModel.value);
}
</script>

<style lang="scss" scoped>

</style>